﻿namespace HRM.CORE
{
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using HRM.CORE.Properties;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms; using Common;

    public class xfmDataTableSchedule : XtraForm
    {
        private SimpleButton bbiClose;
        private SimpleButton bbiOK;
        private IContainer components;
        private PanelControl panelControl1;
        private HRM.CORE.xucSchedule xucSchedule;

        public xfmDataTableSchedule()
        {
            this.components = null;
            this.InitializeComponent();
        }

        public xfmDataTableSchedule(DataTable DataTableEmployee)
        {
            this.components = null;
            this.InitializeComponent();
            this.xucSchedule = new HRM.CORE.xucSchedule(DataTableEmployee);
            this.xucSchedule.Dock = DockStyle.Fill;
            base.Controls.Add(this.xucSchedule);
            this.xucSchedule.BringToFront();
            this.Text = this.Text + " (";
            foreach (DataRow row in DataTableEmployee.Rows)
            {
                this.Text = this.Text + row["FirstName"].ToString() + " " + row["LastName"].ToString() + ", ";
            }
            this.Text = this.Text.Remove(this.Text.Length - 2, 2);
            this.Text = this.Text + ")";
        }

        private void bbiClose_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void bbiOK_Click(object sender, EventArgs e)
        {
            if (this.xucSchedule != null)
            {
                this.xucSchedule.Save();
            }
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.panelControl1 = new PanelControl();
            this.bbiClose = new SimpleButton();
            this.bbiOK = new SimpleButton();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            base.SuspendLayout();
            this.panelControl1.BorderStyle = BorderStyles.NoBorder;
            this.panelControl1.Controls.Add(this.bbiClose);
            this.panelControl1.Controls.Add(this.bbiOK);
            this.panelControl1.Dock = DockStyle.Bottom;
            this.panelControl1.Location = new Point(0, 0x1b1);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(0x2be, 0x2d);
            this.panelControl1.TabIndex = 0;
            this.bbiClose.Image = Resources.Exit;
            this.bbiClose.Location = new Point(0x22d, 10);
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.Size = new Size(90, 0x17);
            this.bbiClose.TabIndex = 1;
            this.bbiClose.Text = "Đ\x00f3ng";
            this.bbiClose.Click += new EventHandler(this.bbiClose_Click);
            this.bbiOK.Image = MsgResc.page_white_g;
            this.bbiOK.Location = new Point(0x1c0, 10);
            this.bbiOK.Name = "bbiOK";
            this.bbiOK.Size = new Size(90, 0x17);
            this.bbiOK.TabIndex = 0;
            this.bbiOK.Text = "Lưu";
            this.bbiOK.Click += new EventHandler(this.bbiOK_Click);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x2be, 0x1de);
            base.Controls.Add(this.panelControl1);
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmDataTableSchedule";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Thiết Lập Lịch Tr\x00ecnh L\x00e0m Việc";
            base.Load += new EventHandler(this.xfmSchedule_Load);
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void xfmSchedule_Load(object sender, EventArgs e)
        {
        }
    }
}

